package com.zhuang.thread.timedwaiting;

public class MyThread extends Thread {
	public static void main(String[] args) {
		MyThread myThread = new MyThread();
		myThread.start();

		for (int i = 0; i < 10; i++) {
			try {
				Thread.sleep(500);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			System.out.println("mythred的线程状态：" + myThread.getState());
		}
	}

	@Override
	public void run() {
		for (int i = 0; i < 99; i++) {
			if (i % 10 == 0) {
				System.out.println("达到要求------------");
			}
			System.out.println(i);
		}
		try {
			Thread.sleep(1000);
			System.out.println("休息1秒~~~~~~~~~~");
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
	}
}
